using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace AvaProvi
{
    public partial class ctlZRiesgo : UserControl
    {
        public ctlZRiesgo()
        {
            InitializeComponent();
        }

        private void zonasRiesgoBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.zonasRiesgoBindingSource.EndEdit();
            this.zonasRiesgoTableAdapter.Update(this.avaluos.ZonasRiesgo);

        }

        private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
        {
            if (((Control)sender).Tag == "1")
                    ultraPopupControlContainer1.PopupControl = listBox1;
            else if(((Control)sender).Tag == "2")
                    ultraPopupControlContainer1.PopupControl = listBox2;
            else
                    ultraPopupControlContainer1.PopupControl = listBox3;

            ultraPopupControlContainer1.Show();
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (((Control)sender).Tag == "1")
                ultraTextEditor1.Text = listBox1.SelectedItem.ToString();
            else if (((Control)sender).Tag == "2")
                ultraTextEditor2.Text = listBox2.SelectedItem.ToString();
            else
                ultraTextEditor3.Text = listBox3.SelectedItem.ToString();
        }


    }
}
